<template>
	<u-dropdown-item :title="title" @change="$emit('change')">
		<view class="slot-content" style="background-color: #FFFFFF;">
			<scroll-view scroll-y="true" style="height: 200rpx;">
				<view class="flex month-list">
					<view style="min-width: 50%;" class="item u-text-center" @click="handleChooseItem(m)"
						v-for="(m,i) in list" :key='i'>
						{{m.label}}
					</view>
				</view>
			</scroll-view>
		</view>
	</u-dropdown-item>
</template>

<script>
	export default {
		props: {
			title: {
				type: String
			},
			list: {
				type: Array,
				required: true
			}
		},
		name: "my-dropdown",
		methods: {
			handleChooseItem(item) {
				this.$emit('input', item.value)
				this.$emit('change', item.value)
				this.$parent.close()
			}
		},
	}
</script>

<style>

</style>
